#include<iostream>
#include<cmath>
using namespace std;

class Point {
    private:
        float x,y;
        friend double power(Point& a,Point& b) {
            float dx = a.x - b.x;
            float dy = a.y - b.y;
            double power = dx * dx + dy * dy;
            return power;
        }
    public:
        Point(float x = 0,float y = 0):x(x),y(y) {}
        friend float distance(Point&,Point&);
};

float distance(Point& a,Point& b){
    float dx = a.x - b.x;
    float dy = a.y - b.y;
    float delta = dx * dx + dy * dy;
    return sqrt(delta);
}

int main(){
    Point a(3.0,4.0),b(4,5);
    float d = distance(a,b);
    cout << "distance = " << d << endl;
    double power = a.power(a,b);
    cout << "power = " << power << endl;
    return 0;
}
